object FormUtl: TFormUtl
  Left = 279
  Top = 305
  Width = 953
  Height = 601
  Caption = #1059#1090#1080#1083#1080#1079#1072#1094#1080#1103
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  Position = poDesktopCenter
  OnHide = FormHide
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  object Label2: TLabel
    Left = 8
    Top = 8
    Width = 206
    Height = 19
    Caption = #1059#1090#1080#1083#1080#1079#1072#1094#1080#1103' '#1072#1074#1090#1086#1087#1072#1088#1082#1072
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'DejaVu Sans'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label1: TLabel
    Left = 8
    Top = 296
    Width = 161
    Height = 19
    Caption = #1044#1086#1082#1091#1084#1077#1085#1090#1099' '#1087#1086' '#1058#1057
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'DejaVu Sans'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label3: TLabel
    Left = 296
    Top = 160
    Width = 62
    Height = 13
    Caption = 'f_date_doc_i'
  end
  object DBGrid1: TDBGrid
    Left = 8
    Top = 48
    Width = 929
    Height = 241
    DataSource = DSBus
    PopupMenu = PopupMenuDoc
    TabOrder = 0
    TitleFont.Charset = DEFAULT_CHARSET
    TitleFont.Color = clWindowText
    TitleFont.Height = -11
    TitleFont.Name = 'MS Sans Serif'
    TitleFont.Style = []
    Columns = <
      item
        Expanded = False
        FieldName = 'NameModels'
        ReadOnly = True
        Title.Caption = #1053#1072#1080#1084#1077#1085#1086#1074#1072#1085#1080#1077' '#1084#1086#1076#1077#1083#1080' '#1058#1057
        Width = 154
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'NUM_BODY'
        ReadOnly = True
        Title.Caption = #1043#1086#1089' '#1053#1086#1084#1077#1088' '#1058#1057
        Width = 92
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'NAME_STATE'
        ReadOnly = True
        Title.Caption = #1057#1086#1089#1090#1086#1103#1085#1080#1077
        Width = 121
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'DATE_DOC_INSURANCE'
        Title.Caption = #1044#1072#1090#1072' '#1074#1099#1076#1072#1095#1080' '#1087#1086#1083#1080#1089#1072
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'NUM_DOC_INSURANCE'
        Title.Caption = #8470' '#1087#1086#1083#1080#1089#1072
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'DATE_DOC_SERVICE'
        Title.Caption = #1044#1072#1090#1072' '#1087#1088#1086#1093#1086#1078#1076#1077#1085#1080#1103' '#1043#1058#1054
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'NUM_DOC_SERVICE'
        Title.Caption = #8470' '#1090#1072#1083#1086#1085#1072' '#1043#1058#1054
        Visible = True
      end>
  end
  object DBGrid2: TDBGrid
    Left = 8
    Top = 328
    Width = 665
    Height = 217
    DataSource = DataSourceDoc
    TabOrder = 1
    TitleFont.Charset = DEFAULT_CHARSET
    TitleFont.Color = clWindowText
    TitleFont.Height = -11
    TitleFont.Name = 'MS Sans Serif'
    TitleFont.Style = []
    OnDrawColumnCell = DBGrid2DrawColumnCell
    OnDblClick = DBGrid2DblClick
    OnKeyDown = DBGrid2KeyDown
    Columns = <
      item
        Color = clGreen
        Expanded = False
        FieldName = 'PARENT_ID_HEAD'
        ReadOnly = True
        Title.Caption = #1040#1082#1090#1080#1074
        Width = 33
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'DATE_DOC'
        Title.Caption = #1044#1072#1090#1072' '#1076#1086#1082#1091#1084#1077#1085#1090#1072
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'NUM_DOC'
        Title.Caption = #8470' '#1076#1086#1082#1091#1084#1077#1085#1090#1072
        Width = 88
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'NAME_STATE'
        Title.Caption = #1057#1086#1089#1090#1086#1103#1085#1080#1077' '#1058#1057
        Width = 188
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'DATE_START_DOC'
        Title.Caption = #1044#1072#1090#1072', '#1074#1088#1077#1084#1103' '#1089#1086#1089#1090#1086#1103#1085#1080#1103
        Width = 190
        Visible = True
      end>
  end
  object Button1: TButton
    Left = 752
    Top = 16
    Width = 89
    Height = 25
    Caption = #1054#1073#1085#1086#1074#1080#1090#1100
    TabOrder = 2
    OnClick = Button1Click
  end
  object Button2: TButton
    Left = 296
    Top = 296
    Width = 65
    Height = 25
    Caption = #1059#1076#1072#1083#1080#1090#1100
    TabOrder = 3
    OnClick = Button2Click
  end
  object ButtonReport: TButton
    Left = 848
    Top = 16
    Width = 89
    Height = 25
    Caption = #1054#1073#1085#1086#1074#1080#1090#1100' '#1086#1090#1095#1077#1090
    TabOrder = 4
    OnClick = ButtonReportClick
  end
  object CheckBoxReport: TCheckBox
    Left = 328
    Top = 8
    Width = 241
    Height = 25
    Caption = #1060#1086#1088#1084#1080#1088#1086#1074#1072#1090#1100' '#1086#1090#1095#1077#1090' '#1074' '#1088#1077#1072#1083#1100#1085#1086#1084' '#1074#1088#1077#1084#1077#1085#1080
    Checked = True
    State = cbChecked
    TabOrder = 5
  end
  object StatusBar: TStatusBar
    Left = 0
    Top = 546
    Width = 945
    Height = 21
    Color = clScrollBar
    Panels = <
      item
        Width = 400
      end
      item
        Width = 50
      end>
    SimplePanel = False
  end
  object pFIBDataSetBus: TpFIBDataSet
    SelectSQL.Strings = (
      'select '
      '    bus.id,'
      '    bus.id_models,'
      '    bus.num_body,'
      '    bus.vin,'
      '    bus.num_vr,'
      '    bus.date_vr,'
      '    bus.num_ts,'
      '    bus.date_ts,'
      '    bus.id_head_insurance,'
      '    bus.id_head_vr,'
      '    bus.id_head_ts,'
      '    bus.id_head_state,'
      '    bus.id_state,'
      '    head_i.date_start_doc date_doc_insurance,'
      '    head_s.date_start_doc date_doc_service,'
      '    head_i.num_doc num_doc_insurance,'
      '    head_s.num_doc num_doc_service,'
      '    state_bus.name_state,'
      '    state_bus.var_color'
      'from bus'
      '   left outer join state_bus on (state_bus.id = bus.id_state)'
      
        '   left outer join head head_s on (bus.id_head_service = head_s.' +
        'id)'
      
        '   left outer join head head_i on (bus.id_head_insurance = head_' +
        'i.id)')
    AutoUpdateOptions.UpdateTableName = 'BUS'
    AutoUpdateOptions.KeyFields = 'ID'
    AutoUpdateOptions.AutoReWriteSqls = True
    AutoUpdateOptions.CanChangeSQLs = True
    AutoUpdateOptions.UpdateOnlyModifiedFields = True
    Transaction = DataModule_tms.pFIBTransaction_tms
    Database = DataModule_tms.pFIBDatabase_tms
    AutoCommit = True
    Left = 848
    Top = 184
    object pFIBDataSetBusID: TFIBBCDField
      FieldName = 'ID'
      Size = 0
      RoundByScale = True
    end
    object pFIBDataSetBusID_MODELS: TFIBBCDField
      FieldName = 'ID_MODELS'
      Size = 0
      RoundByScale = True
    end
    object pFIBDataSetBusNUM_BODY: TFIBStringField
      FieldName = 'NUM_BODY'
      EmptyStrToNull = True
    end
    object pFIBDataSetBusVIN: TFIBStringField
      FieldName = 'VIN'
      EmptyStrToNull = True
    end
    object pFIBDataSetBusNUM_VR: TFIBStringField
      FieldName = 'NUM_VR'
      Size = 50
      EmptyStrToNull = True
    end
    object pFIBDataSetBusDATE_VR: TFIBDateField
      FieldName = 'DATE_VR'
      DisplayFormat = 'dd.mm.yyyy'
    end
    object pFIBDataSetBusNUM_TS: TFIBStringField
      FieldName = 'NUM_TS'
      Size = 50
      EmptyStrToNull = True
    end
    object pFIBDataSetBusDATE_TS: TFIBDateField
      FieldName = 'DATE_TS'
      DisplayFormat = 'dd.mm.yyyy'
    end
    object pFIBDataSetBusNameModels: TStringField
      FieldKind = fkLookup
      FieldName = 'NameModels'
      LookupDataSet = pFIBDataSetModels
      LookupKeyFields = 'ID'
      LookupResultField = 'NAME_MODELS'
      KeyFields = 'ID_MODELS'
      Size = 50
      Lookup = True
    end
    object pFIBDataSetBusID_STATE: TFIBBCDField
      FieldName = 'ID_STATE'
      Size = 0
      RoundByScale = True
    end
    object pFIBDataSetBusNAME_STATE: TFIBStringField
      FieldName = 'NAME_STATE'
      Size = 100
      EmptyStrToNull = True
    end
    object pFIBDataSetBusID_HEAD_STATE: TFIBBCDField
      FieldName = 'ID_HEAD_STATE'
      Size = 0
      RoundByScale = True
    end
    object pFIBDataSetBusDATE_DOC_INSURANCE: TFIBDateTimeField
      FieldName = 'DATE_DOC_INSURANCE'
      DisplayFormat = 'dd.MM.yyyy'
    end
    object pFIBDataSetBusDATE_DOC_SERVICE: TFIBDateTimeField
      FieldName = 'DATE_DOC_SERVICE'
      DisplayFormat = 'dd.MM.yyyy'
    end
    object pFIBDataSetBusNUM_DOC_INSURANCE: TFIBStringField
      FieldName = 'NUM_DOC_INSURANCE'
      EmptyStrToNull = True
    end
    object pFIBDataSetBusNUM_DOC_SERVICE: TFIBStringField
      FieldName = 'NUM_DOC_SERVICE'
      EmptyStrToNull = True
    end
  end
  object pFIBDataSetModels: TpFIBDataSet
    CachedUpdates = True
    SelectSQL.Strings = (
      'select * from models')
    Transaction = DataModule_tms.pFIBTransaction_tms
    Database = DataModule_tms.pFIBDatabase_tms
    UpdateTransaction = DataModule_tms.pFIBTransactionLookup
    Left = 736
    Top = 88
  end
  object DSBus: TDataSource
    DataSet = pFIBDataSetBus
    Left = 848
    Top = 224
  end
  object PopupMenuDoc: TPopupMenu
    Left = 216
    Top = 16
    object N1: TMenuItem
      Caption = #1042#1074#1086#1076' '#1058#1057' '#1074' '#1072#1074#1090#1086#1087#1072#1088#1082
      OnClick = N1Click
    end
    object N2: TMenuItem
      Caption = #1042#1099#1093#1086#1076' '#1085#1072' '#1084#1072#1088#1096#1088#1091#1090
      OnClick = N2Click
    end
    object N3: TMenuItem
      Caption = #1055#1083#1072#1085#1086#1074#1086#1077' '#1058#1054
      OnClick = N3Click
    end
    object N4: TMenuItem
      Caption = #1057#1093#1086#1076', '#1088#1077#1084#1086#1085#1090
      OnClick = N4Click
    end
    object N5: TMenuItem
      Caption = #1055#1088#1086#1089#1090#1086#1081', '#1089#1090#1086#1103#1085#1082#1072
      OnClick = N5Click
    end
    object N6: TMenuItem
      Caption = #1044#1058#1055', '#1086#1092#1086#1088#1084#1083#1077#1085#1080#1077
      OnClick = N6Click
    end
    object N7: TMenuItem
      Caption = #1055#1088#1086#1076#1072#1078#1072' '#1058#1057
      OnClick = N7Click
    end
    object N10: TMenuItem
      Caption = '-'
    end
    object N11: TMenuItem
      Caption = #1055#1088#1086#1093#1086#1078#1076#1077#1085#1080#1077' '#1075#1086#1089'.'#1090#1077#1093'.'#1086#1089#1084#1086#1090#1088#1072
      OnClick = N11Click
    end
    object N12: TMenuItem
      Caption = #1057#1090#1088#1072#1093#1086#1074#1086#1081' '#1087#1086#1083#1080#1089
      OnClick = N12Click
    end
    object N8: TMenuItem
      Caption = '-'
    end
    object N9: TMenuItem
      Caption = #1042#1099#1074#1086#1076' '#1080#1079' '#1101#1082#1089#1087#1083#1091#1072#1090#1072#1094#1080#1080
      OnClick = N9Click
    end
  end
  object ds_doc: TpFIBDataSet
    SelectSQL.Strings = (
      'select '
      '    head.id,head.parent_id_head,'
      '    head.id_bus,'
      '    head.date_doc,head.date_save_doc,'
      '    head.num_doc,'
      '    head.id_state,'
      '    state_bus.name_state,'
      '    head.id_route,'
      '    route.name_route,'
      '    head.date_start_doc,'
      '    head.date_end_doc,'
      '    head.id_personal_driver,'
      '    driver.fio'
      'from head '
      
        '   left outer join personal driver on (driver.id = head.id_perso' +
        'nal_driver)'
      '   inner join state_bus on (head.id_state = state_bus.id)'
      '   left outer join route on (head.id_route = route.id)'
      'where head.id_bus=:mas_id '
      'and head.id_state in (1,2,3,4,5,6,7,13,14,15)'
      'order by head.date_start_doc desc')
    Transaction = DataModule_tms.pFIBTransaction_tms
    Database = DataModule_tms.pFIBDatabase_tms
    DataSource = DSBus
    Left = 352
    Top = 440
    object ds_docID: TFIBBCDField
      FieldName = 'ID'
      Size = 0
      RoundByScale = True
    end
    object ds_docID_BUS: TFIBBCDField
      FieldName = 'ID_BUS'
      Size = 0
      RoundByScale = True
    end
    object ds_docDATE_DOC: TFIBDateField
      DefaultExpression = 'current_date'
      FieldName = 'DATE_DOC'
      DisplayFormat = 'dd.mm.yyyy'
    end
    object ds_docNUM_DOC: TFIBStringField
      FieldName = 'NUM_DOC'
      EmptyStrToNull = True
    end
    object ds_docID_STATE: TFIBBCDField
      FieldName = 'ID_STATE'
      Size = 0
      RoundByScale = True
    end
    object ds_docNAME_STATE: TFIBStringField
      FieldName = 'NAME_STATE'
      Size = 100
      EmptyStrToNull = True
    end
    object ds_docID_ROUTE: TFIBBCDField
      FieldName = 'ID_ROUTE'
      Size = 0
      RoundByScale = True
    end
    object ds_docNAME_ROUTE: TFIBStringField
      FieldName = 'NAME_ROUTE'
      Size = 50
      EmptyStrToNull = True
    end
    object ds_docDATE_START_DOC: TFIBDateTimeField
      FieldName = 'DATE_START_DOC'
      DisplayFormat = 'dd.mm.yyyy hh:mm'
    end
    object ds_docDATE_END_DOC: TFIBDateTimeField
      FieldName = 'DATE_END_DOC'
      DisplayFormat = 'dd.mm.yyyy hh:mm AMPM'
    end
    object ds_docID_PERSONAL_DRIVER: TFIBBCDField
      FieldName = 'ID_PERSONAL_DRIVER'
      Size = 0
      RoundByScale = True
    end
    object ds_docFIO: TFIBStringField
      FieldName = 'FIO'
      Size = 200
      EmptyStrToNull = True
    end
    object ds_docPARENT_ID_HEAD: TFIBBCDField
      FieldName = 'PARENT_ID_HEAD'
      Size = 0
      RoundByScale = True
    end
    object ds_docDATE_SAVE_DOC: TFIBDateTimeField
      FieldName = 'DATE_SAVE_DOC'
      DisplayFormat = 'dd.mm.yyyy hh:mm AMPM'
    end
  end
  object DataSourceDoc: TDataSource
    DataSet = ds_doc
    Left = 320
    Top = 440
  end
  object proc_delete: TpFIBStoredProc
    Transaction = DataModule_tms.TransactionWrite
    Database = DataModule_tms.pFIBDatabase_tms
    SQL.Strings = (
      'EXECUTE PROCEDURE DEL_DOC (?P_ID_HEAD)')
    StoredProcName = 'DEL_DOC'
    Left = 288
    Top = 440
  end
  object frxReportHtml: TfrxReport
    Version = '4.9'
    DataSetName = 'frxDBDataset1'
    DotMatrixReport = False
    IniFile = '\Software\Fast Reports'
    PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick]
    PreviewOptions.Zoom = 1
    PrintOptions.Printer = 'Default'
    PrintOptions.PrintOnSheet = 0
    ReportOptions.CreateDate = 41544.9312232292
    ReportOptions.LastChange = 41558.5213209144
    ScriptLanguage = 'C++Script'
    StoreInDFM = False
    Left = 864
    Top = 88
  end
  object frxFIBComponents1: TfrxFIBComponents
    Left = 896
    Top = 88
  end
  object frxHTMLExport: TfrxHTMLExport
    ShowDialog = False
    ExportNotPrintable = True
    UseFileCache = True
    ShowProgress = True
    OverwritePrompt = False
    FixedWidth = True
    Background = False
    Centered = True
    EmptyLines = True
    Print = False
    Left = 832
    Top = 88
  end
  object frxXLSExport: TfrxXLSExport
    ShowDialog = False
    UseFileCache = True
    ShowProgress = False
    OverwritePrompt = False
    ExportEMF = True
    AsText = False
    Background = True
    FastExport = True
    PageBreaks = True
    EmptyLines = True
    SuppressPageHeadersFooters = False
    Left = 800
    Top = 88
  end
  object frxPDFExport: TfrxPDFExport
    ShowDialog = False
    UseFileCache = True
    ShowProgress = True
    OverwritePrompt = False
    PrintOptimized = False
    Outline = False
    Background = False
    HTMLTags = True
    Author = 'FastReport'
    Subject = 'FastReport PDF export'
    ProtectionFlags = [ePrint, eModify, eCopy, eAnnot]
    HideToolbar = False
    HideMenubar = False
    HideWindowUI = False
    FitWindow = False
    CenterWindow = False
    PrintScaling = False
    Left = 768
    Top = 88
  end
  object event_send: TSIBfibEventAlerter
    Events.Strings = (
      'UPDATE')
    OnEventAlert = event_sendEventAlert
    Database = DataModule_tms.pFIBDatabase_tms
    Left = 816
    Top = 184
  end
  object ftp_tms: TNMFTP
    Host = 'ftp.elenafed.nichost.ru'
    Port = 21
    ReportLevel = 0
    OnConnect = ftp_tmsConnect
    OnConnectionFailed = ftp_tmsConnectionFailed
    UserID = 'elenafed_tms'
    Password = 'c6xjsuwj'
    OnSuccess = ftp_tmsSuccess
    OnListItem = ftp_tmsListItem
    Vendor = 2411
    ParseList = False
    ProxyPort = 0
    Passive = False
    FirewallType = FTUser
    FWAuthenticate = False
    Left = 872
    Top = 320
  end
end
